From: Tassilo Horn Date: Mon, 22 Nov 2010 08:09:41 +0000 (+0100) Subject: * textmodes/reftex-ref.el (reftex-goto-label): Use the current X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~5574 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=2756433d96b6268b9f83864c9d2bb9c28d6a23d7;p=emacs.git * textmodes/reftex-ref.el (reftex-goto-label): Use the current \ref's or \pageref's value as default instead of initial input. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 73025cca3aa..b284464f29b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-11-22 Tassilo Horn + + * textmodes/reftex-ref.el (reftex-goto-label): Use the current + \ref's or \pageref's value as default instead of initial input. + 2010-11-21 Michael Albinus * files.el (backup-by-copying-when-mismatch): The default value is diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index ff3ffbc20ba..91cc77480eb 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -237,9 +237,9 @@ This function is controlled by the settings of reftex-insert-label-flags." (setq label default)) ;; Insert the label into the label list - (let* ((here-I-am-info + (let* ((here-I-am-info (save-excursion - (if (and (or naked no-insert) + (if (and (or naked no-insert) (integerp (cdr macro-cell))) (goto-char (cdr macro-cell))) (reftex-where-am-I))) @@ -830,13 +830,16 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window." (reftex-access-scan-info) (let* ((wcfg (current-window-configuration)) (docstruct (symbol-value reftex-docstruct-symbol)) - (label (completing-read "Label: " docstruct - (lambda (x) (stringp (car x))) t - ;; If point is inside a \ref{} or - ;; \pageref{}, use that as initial - ;; input. - (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*") - (reftex-this-word "-a-zA-Z0-9_*.:")))) + ;; If point is inside a \ref{} or \pageref{}, use that as + ;; default value. + (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*") + (reftex-this-word "-a-zA-Z0-9_*.:"))) + (label (completing-read (if default + (format "Label (default %s): " default) + "Label: ") + docstruct + (lambda (x) (stringp (car x))) t nil nil + default)) (selection (assoc label docstruct)) (where (progn (reftex-show-label-location selection t nil 'stay)